<script setup lang="ts">
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import AppLayout from './components/layout/AppLayout.vue';

const route = useRoute();

// 判断当前页面是否需要显示主布局
// 登录页面不需要显示主布局
const showMainLayout = computed(() => {
  return !route.path.includes('/login');
});
</script>

<template>
  <!-- 根据路由决定是否显示主布局 -->
  <AppLayout v-if="showMainLayout">
    <router-view />
  </AppLayout>
  <router-view v-else />
</template>

<style>
/* 全局样式可以在这里添加 */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
}

#app {
  height: 100%;
}
</style>
